
#include "PAC.h"



void init_PACA(void) 
{
  //enable the pulse accumulator A
   PACTL_PAEN = 1;
  // PBCTL_PBEN = 1;
  //set the accumulator A mode. 0: event counter mode
  PACTL_PAMOD = 0;
  //the accumulator edge control
  PACTL_PEDGE = 1; //1 = rising edges on PT7 pin cause the count to be incremented
  //enable the pulse accumulator B
  PBCTL_PBEN=1;
  //the accumulator edge control
  TCTL4_EDG0A=1; 
  TCTL4_EDG0B=0; //rising edges on PT0 pin cause the count to be incremented
  //the PT0 direction control:as IC;
  TIOS_IOS0=0;
}

void set_PACA(xuint16 val)
{
  PACN32 = val;
	// PACN10 = val;
}

void set_PACA_L(xuint16 val)
{
  PACN32 = val;
	// PACN10 = val;
}


void set_PACA_R(xuint16 val)
{
  PACN10 = val;
	// PACN10 = val;
}


xuint16 get_PACA(void) 
{
  return PACN32;
 // return PACN10;
}

xuint16 get_PACA_L(void) 
{
  return PACN32;
 // return PACN10;
}

xuint16 get_PACA_R(void) 
{
  return PACN10;
 // return PACN10;
}
